﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cms.BLL.Menu;

namespace Cms.Admin.Article
{
    public partial class Default : PageBase
    {
        private string _menuID;
        private string MenuID
        {
            get
            {
                if (_menuID == null)
                {
                    MenuBO menu = new MenuBO();

                    if (string.IsNullOrEmpty(Request["MenuCode"]))
                    {                        
                        _menuID = menu.GetRootID().ToString();
                    }
                    else
                    {
                        object id = menu.GetIDByCode(Request["MenuCode"]);
                        if (id != null)
                        {
                            _menuID = id.ToString();
                        }
                        else
                        {
                            Response.Write("Code不存在");
                            Response.End();
                        }
                    }
                }
                return _menuID;
            }
        }

       
        protected void Page_Load(object sender, EventArgs e)
        {
            
                MenuBO menu = new MenuBO();

                this.List.Attributes["src"] = "List.aspx?MenuID=" + this.Encrypt(MenuID);

                this.left.Attributes["src"] = "MenuTree.aspx?MenuID=" + this.Encrypt(MenuID);
          

        }
    }
}
